package dao.pojo;

import static javax.persistence.GenerationType.IDENTITY;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "exam", catalog = "makeiteasy")
public class Exam implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 1L;
	private Integer examId;
	private Teacher teacher;
	private Test test;
	private String examClasses;
	private String examName;
	private Timestamp examCreateDate;
	private Timestamp examBeginDate;
	private Timestamp examEndDate;
	private Float examHour;
	private Float examFullScore;
	private Float examPassScore;

	// Constructors

	/** default constructor */
	public Exam() {
	}

	/** minimal constructor */
	public Exam(Integer examId, String examName) {
		this.examId = examId;
		this.examName = examName;
	}

	/** full constructor */
	public Exam(Integer examId, Teacher teacher, Test test, String examClasses,
			String examName, Timestamp examCreateDate, Timestamp examBeginDate,
			Timestamp examEndDate, Float examHour, Float examFullScore,
			Float examPassScore) {
		this.examId = examId;
		this.teacher = teacher;
		this.test = test;
		this.examClasses = examClasses;
		this.examName = examName;
		this.examCreateDate = examCreateDate;
		this.examBeginDate = examBeginDate;
		this.examEndDate = examEndDate;
		this.examHour = examHour;
		this.examFullScore = examFullScore;
		this.examPassScore = examPassScore;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "examId", unique = true, nullable = false)
	public Integer getExamId() {
		return this.examId;
	}

	public void setExamId(Integer examId) {
		this.examId = examId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "teaId")
	public Teacher getTeacher() {
		return this.teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "testId")
	public Test getTest() {
		return this.test;
	}

	public void setTest(Test test) {
		this.test = test;
	}

	@Column(name = "examClasses", length = 16)
	public String getExamClasses() {
		return this.examClasses;
	}

	public void setExamClasses(String examClasses) {
		this.examClasses = examClasses;
	}

	@Column(name = "examName", nullable = false, length = 100)
	public String getExamName() {
		return this.examName;
	}

	public void setExamName(String examName) {
		this.examName = examName;
	}

	@Column(name = "examCreateDate", length = 19)
	public Timestamp getExamCreateDate() {
		return this.examCreateDate;
	}

	public void setExamCreateDate(Timestamp examCreateDate) {
		this.examCreateDate = examCreateDate;
	}

	@Column(name = "examBeginDate", length = 19)
	public Timestamp getExamBeginDate() {
		return this.examBeginDate;
	}

	public void setExamBeginDate(Timestamp examBeginDate) {
		this.examBeginDate = examBeginDate;
	}

	@Column(name = "examEndDate", length = 19)
	public Timestamp getExamEndDate() {
		return this.examEndDate;
	}

	public void setExamEndDate(Timestamp examEndDate) {
		this.examEndDate = examEndDate;
	}

	@Column(name = "examHour", precision = 12, scale = 0)
	public Float getExamHour() {
		return this.examHour;
	}

	public void setExamHour(Float examHour) {
		this.examHour = examHour;
	}

	@Column(name = "examFullScore", precision = 12, scale = 0)
	public Float getExamFullScore() {
		return this.examFullScore;
	}

	public void setExamFullScore(Float examFullScore) {
		this.examFullScore = examFullScore;
	}

	@Column(name = "examPassScore", precision = 12, scale = 0)
	public Float getExamPassScore() {
		return this.examPassScore;
	}

	public void setExamPassScore(Float examPassScore) {
		this.examPassScore = examPassScore;
	}

}